package com.dragon.modules.yuegou.query.member;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dragon.modules.yuegou.entity.member.ShippingAddressEntity;
import com.dragon.modules.yuegou.mybatis.Condition;
import com.dragon.modules.yuegou.mybatis.Query;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonUnwrapped;

import java.time.LocalDateTime;

/**
 * 收货地址管理 动态查询条件
 * 
 * @author pbuilder generated
 * @date 2020-02-25 10:48:46
 * @version 2.0
 */
@JsonInclude(Include.NON_NULL)
public class ShippingAddressQuery extends ShippingAddressEntity implements Query<ShippingAddressEntity> {

    /** 查询条件 */
	@JsonUnwrapped(prefix = "id")
	private Condition<String> idCondition;

    /** 查询条件 */
	@JsonUnwrapped(prefix = "memberId")
	private Condition<String> memberIdCondition;

    /** 收货人名称查询条件 */
	@JsonUnwrapped(prefix = "name")
	private Condition<String> nameCondition;

    /** 收货人手机号码查询条件 */
	@JsonUnwrapped(prefix = "mobile")
	private Condition<String> mobileCondition;

    /** 省查询条件 */
	@JsonUnwrapped(prefix = "province")
	private Condition<String> provinceCondition;

    /** 市查询条件 */
	@JsonUnwrapped(prefix = "city")
	private Condition<String> cityCondition;

    /** 区查询条件 */
	@JsonUnwrapped(prefix = "county")
	private Condition<String> countyCondition;

    /** 街道查询条件 */
	@JsonUnwrapped(prefix = "street")
	private Condition<String> streetCondition;

    /** 详细地址查询条件 */
	@JsonUnwrapped(prefix = "address")
	private Condition<String> addressCondition;

    /**  是否默认收货地址 0 否 1是查询条件 */
	@JsonUnwrapped(prefix = "addressDefault")
	private Condition<Boolean> addressDefaultCondition;

    /** 创建人查询条件 */
	@JsonUnwrapped(prefix = "createdBy")
	private Condition<String> createdByCondition;

    /** 创建时间查询条件 */
	@JsonUnwrapped(prefix = "createdTime")
	private Condition<LocalDateTime> createdTimeCondition;

    /** 修改人查询条件 */
	@JsonUnwrapped(prefix = "modifiedBy")
	private Condition<String> modifiedByCondition;

    /** 修改时间查询条件 */
	@JsonUnwrapped(prefix = "modifiedTime")
	private Condition<LocalDateTime> modifiedTimeCondition;

    /** 逻辑删除，1表示已删除,0表示未删除查询条件 */
	@JsonUnwrapped(prefix = "del")
	private Condition<Boolean> delCondition;

    /** 删除人查询条件 */
	@JsonUnwrapped(prefix = "delBy")
	private Condition<String> delByCondition;

    /** 删除时间查询条件 */
	@JsonUnwrapped(prefix = "delTime")
	private Condition<LocalDateTime> delTimeCondition;

	/**
	 * 构造一个查询条件对象
	 */
	public ShippingAddressQuery() {
		super();
	}

	/**
	 * 依据实体对象构造一个查询条件对象
	 * 
	 * @param entity 实体对象
	 */
	public ShippingAddressQuery(ShippingAddressEntity entity) {
		super(entity);
	}

	/**
	 * 依据其它查询条件对象的信息构造一个查询条件对象
	 * 
	 * @param other 查询条件对象
	 */
	public ShippingAddressQuery(ShippingAddressQuery other) {
		super(other);
		if (other.idCondition != null) {
			this.idCondition = other.idCondition.copy();
		}
		if (other.memberIdCondition != null) {
			this.memberIdCondition = other.memberIdCondition.copy();
		}
		if (other.nameCondition != null) {
			this.nameCondition = other.nameCondition.copy();
		}
		if (other.mobileCondition != null) {
			this.mobileCondition = other.mobileCondition.copy();
		}
		if (other.provinceCondition != null) {
			this.provinceCondition = other.provinceCondition.copy();
		}
		if (other.cityCondition != null) {
			this.cityCondition = other.cityCondition.copy();
		}
		if (other.countyCondition != null) {
			this.countyCondition = other.countyCondition.copy();
		}
		if (other.streetCondition != null) {
			this.streetCondition = other.streetCondition.copy();
		}
		if (other.addressCondition != null) {
			this.addressCondition = other.addressCondition.copy();
		}
		if (other.addressDefaultCondition != null) {
			this.addressDefaultCondition = other.addressDefaultCondition.copy();
		}
		if (other.createdByCondition != null) {
			this.createdByCondition = other.createdByCondition.copy();
		}
		if (other.createdTimeCondition != null) {
			this.createdTimeCondition = other.createdTimeCondition.copy();
		}
		if (other.modifiedByCondition != null) {
			this.modifiedByCondition = other.modifiedByCondition.copy();
		}
		if (other.modifiedTimeCondition != null) {
			this.modifiedTimeCondition = other.modifiedTimeCondition.copy();
		}
		this.setOther(other);
	}

	private void setOther(ShippingAddressQuery other){
		if(other.delCondition != null) {
			this.delCondition = other.delCondition.copy();
		}
		if(other.delByCondition != null) {
			this.delByCondition = other.delByCondition.copy();
		}
		if(other.delTimeCondition != null) {
			this.delTimeCondition = other.delTimeCondition.copy();
		}
	}

	@Override
	public QueryWrapper<ShippingAddressEntity> toQueryWrapper() {
		QueryWrapper<ShippingAddressEntity> wrapper = new QueryWrapper<>(this);
		if (idCondition != null) {
			idCondition.toWrapper(wrapper, COL_ID);
		}
		if (memberIdCondition != null) {
			memberIdCondition.toWrapper(wrapper, COL_MEMBER_ID);
		}
		if (nameCondition != null) {
			nameCondition.toWrapper(wrapper, COL_NAME);
		}
		if (mobileCondition != null) {
			mobileCondition.toWrapper(wrapper, COL_MOBILE);
		}
		if (provinceCondition != null) {
			provinceCondition.toWrapper(wrapper, COL_PROVINCE);
		}
		if (cityCondition != null) {
			cityCondition.toWrapper(wrapper, COL_CITY);
		}
		if (countyCondition != null) {
			countyCondition.toWrapper(wrapper, COL_COUNTY);
		}
		if (streetCondition != null) {
			streetCondition.toWrapper(wrapper, COL_STREET);
		}
		if (addressCondition != null) {
			addressCondition.toWrapper(wrapper, COL_ADDRESS);
		}
		if (addressDefaultCondition != null) {
			addressDefaultCondition.toWrapper(wrapper, COL_ADDRESS_DEFAULT);
		}
		if (createdByCondition != null) {
			createdByCondition.toWrapper(wrapper, COL_CREATED_BY);
		}
		if (createdTimeCondition != null) {
			createdTimeCondition.toWrapper(wrapper, COL_CREATED_TIME);
		}
		if (modifiedByCondition != null) {
			modifiedByCondition.toWrapper(wrapper, COL_MODIFIED_BY);
		}
		if (modifiedTimeCondition != null) {
			modifiedTimeCondition.toWrapper(wrapper, COL_MODIFIED_TIME);
		}
		return getQueryWrapper(wrapper);
	}

	private QueryWrapper<ShippingAddressEntity> getQueryWrapper(QueryWrapper<ShippingAddressEntity> wrapper){
		if (delCondition != null) {
			delCondition.toWrapper(wrapper, COL_DEL);
		}
		if (delByCondition != null) {
			delByCondition.toWrapper(wrapper, COL_DEL_BY);
		}
		if (delTimeCondition != null) {
			delTimeCondition.toWrapper(wrapper, COL_DEL_TIME);
		}
		return wrapper;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> id() {
		this.idCondition = new Condition<>();
		return this.idCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return idCondition 查询条件
	 */
	public Condition<String> getIdCondition() {
		return idCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param idCondition 查询条件
	 */
	public void setIdCondition(Condition<String> idCondition) {
		this.idCondition = idCondition;
	}

	/**
	 * 构造并返回查询条件
	 * 
	 * @return memberIdCondition 查询条件
	 */
	public Condition<String> memberId() {
		this.memberIdCondition = new Condition<>();
		return this.memberIdCondition;
	}
	
	/**
	 * 获取查询条件
	 * 
	 * @return memberIdCondition 查询条件
	 */
	public Condition<String> getMemberIdCondition() {
		return memberIdCondition;
	}

	/**
	 * 设置查询条件
	 * 
	 * @param memberIdCondition 查询条件
	 */
	public void setMemberIdCondition(Condition<String> memberIdCondition) {
		this.memberIdCondition = memberIdCondition;
	}

	/**
	 * 构造并返回收货人名称查询条件
	 * 
	 * @return nameCondition 收货人名称查询条件
	 */
	public Condition<String> name() {
		this.nameCondition = new Condition<>();
		return this.nameCondition;
	}
	
	/**
	 * 获取收货人名称查询条件
	 * 
	 * @return nameCondition 收货人名称查询条件
	 */
	public Condition<String> getNameCondition() {
		return nameCondition;
	}

	/**
	 * 设置收货人名称查询条件
	 * 
	 * @param nameCondition 收货人名称查询条件
	 */
	public void setNameCondition(Condition<String> nameCondition) {
		this.nameCondition = nameCondition;
	}

	/**
	 * 构造并返回收货人手机号码查询条件
	 * 
	 * @return mobileCondition 收货人手机号码查询条件
	 */
	public Condition<String> mobile() {
		this.mobileCondition = new Condition<>();
		return this.mobileCondition;
	}
	
	/**
	 * 获取收货人手机号码查询条件
	 * 
	 * @return mobileCondition 收货人手机号码查询条件
	 */
	public Condition<String> getMobileCondition() {
		return mobileCondition;
	}

	/**
	 * 设置收货人手机号码查询条件
	 * 
	 * @param mobileCondition 收货人手机号码查询条件
	 */
	public void setMobileCondition(Condition<String> mobileCondition) {
		this.mobileCondition = mobileCondition;
	}

	/**
	 * 构造并返回省查询条件
	 * 
	 * @return provinceCondition 省查询条件
	 */
	public Condition<String> province() {
		this.provinceCondition = new Condition<>();
		return this.provinceCondition;
	}
	
	/**
	 * 获取省查询条件
	 * 
	 * @return provinceCondition 省查询条件
	 */
	public Condition<String> getProvinceCondition() {
		return provinceCondition;
	}

	/**
	 * 设置省查询条件
	 * 
	 * @param provinceCondition 省查询条件
	 */
	public void setProvinceCondition(Condition<String> provinceCondition) {
		this.provinceCondition = provinceCondition;
	}

	/**
	 * 构造并返回市查询条件
	 * 
	 * @return cityCondition 市查询条件
	 */
	public Condition<String> city() {
		this.cityCondition = new Condition<>();
		return this.cityCondition;
	}
	
	/**
	 * 获取市查询条件
	 * 
	 * @return cityCondition 市查询条件
	 */
	public Condition<String> getCityCondition() {
		return cityCondition;
	}

	/**
	 * 设置市查询条件
	 * 
	 * @param cityCondition 市查询条件
	 */
	public void setCityCondition(Condition<String> cityCondition) {
		this.cityCondition = cityCondition;
	}

	/**
	 * 构造并返回区查询条件
	 * 
	 * @return countyCondition 区查询条件
	 */
	public Condition<String> county() {
		this.countyCondition = new Condition<>();
		return this.countyCondition;
	}
	
	/**
	 * 获取区查询条件
	 * 
	 * @return countyCondition 区查询条件
	 */
	public Condition<String> getCountyCondition() {
		return countyCondition;
	}

	/**
	 * 设置区查询条件
	 * 
	 * @param countyCondition 区查询条件
	 */
	public void setCountyCondition(Condition<String> countyCondition) {
		this.countyCondition = countyCondition;
	}

	/**
	 * 构造并返回街道查询条件
	 * 
	 * @return streetCondition 街道查询条件
	 */
	public Condition<String> street() {
		this.streetCondition = new Condition<>();
		return this.streetCondition;
	}
	
	/**
	 * 获取街道查询条件
	 * 
	 * @return streetCondition 街道查询条件
	 */
	public Condition<String> getStreetCondition() {
		return streetCondition;
	}

	/**
	 * 设置街道查询条件
	 * 
	 * @param streetCondition 街道查询条件
	 */
	public void setStreetCondition(Condition<String> streetCondition) {
		this.streetCondition = streetCondition;
	}

	/**
	 * 构造并返回详细地址查询条件
	 * 
	 * @return addressCondition 详细地址查询条件
	 */
	public Condition<String> address() {
		this.addressCondition = new Condition<>();
		return this.addressCondition;
	}
	
	/**
	 * 获取详细地址查询条件
	 * 
	 * @return addressCondition 详细地址查询条件
	 */
	public Condition<String> getAddressCondition() {
		return addressCondition;
	}

	/**
	 * 设置详细地址查询条件
	 * 
	 * @param addressCondition 详细地址查询条件
	 */
	public void setAddressCondition(Condition<String> addressCondition) {
		this.addressCondition = addressCondition;
	}

	/**
	 * 构造并返回 是否默认收货地址 0 否 1是查询条件
	 * 
	 * @return addressDefaultCondition  是否默认收货地址 0 否 1是查询条件
	 */
	public Condition<Boolean> addressDefault() {
		this.addressDefaultCondition = new Condition<>();
		return this.addressDefaultCondition;
	}
	
	/**
	 * 获取 是否默认收货地址 0 否 1是查询条件
	 * 
	 * @return addressDefaultCondition  是否默认收货地址 0 否 1是查询条件
	 */
	public Condition<Boolean> getAddressDefaultCondition() {
		return addressDefaultCondition;
	}

	/**
	 * 设置 是否默认收货地址 0 否 1是查询条件
	 * 
	 * @param addressDefaultCondition  是否默认收货地址 0 否 1是查询条件
	 */
	public void setAddressDefaultCondition(Condition<Boolean> addressDefaultCondition) {
		this.addressDefaultCondition = addressDefaultCondition;
	}

	/**
	 * 构造并返回创建人查询条件
	 * 
	 * @return createdByCondition 创建人查询条件
	 */
	public Condition<String> createdBy() {
		this.createdByCondition = new Condition<>();
		return this.createdByCondition;
	}
	
	/**
	 * 获取创建人查询条件
	 * 
	 * @return createdByCondition 创建人查询条件
	 */
	public Condition<String> getCreatedByCondition() {
		return createdByCondition;
	}

	/**
	 * 设置创建人查询条件
	 * 
	 * @param createdByCondition 创建人查询条件
	 */
	public void setCreatedByCondition(Condition<String> createdByCondition) {
		this.createdByCondition = createdByCondition;
	}

	/**
	 * 构造并返回创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> createdTime() {
		this.createdTimeCondition = new Condition<>();
		return this.createdTimeCondition;
	}
	
	/**
	 * 获取创建时间查询条件
	 * 
	 * @return createdTimeCondition 创建时间查询条件
	 */
	public Condition<LocalDateTime> getCreatedTimeCondition() {
		return createdTimeCondition;
	}

	/**
	 * 设置创建时间查询条件
	 * 
	 * @param createdTimeCondition 创建时间查询条件
	 */
	public void setCreatedTimeCondition(Condition<LocalDateTime> createdTimeCondition) {
		this.createdTimeCondition = createdTimeCondition;
	}

	/**
	 * 构造并返回修改人查询条件
	 * 
	 * @return modifiedByCondition 修改人查询条件
	 */
	public Condition<String> modifiedBy() {
		this.modifiedByCondition = new Condition<>();
		return this.modifiedByCondition;
	}
	
	/**
	 * 获取修改人查询条件
	 * 
	 * @return modifiedByCondition 修改人查询条件
	 */
	public Condition<String> getModifiedByCondition() {
		return modifiedByCondition;
	}

	/**
	 * 设置修改人查询条件
	 * 
	 * @param modifiedByCondition 修改人查询条件
	 */
	public void setModifiedByCondition(Condition<String> modifiedByCondition) {
		this.modifiedByCondition = modifiedByCondition;
	}

	/**
	 * 构造并返回修改时间查询条件
	 * 
	 * @return modifiedTimeCondition 修改时间查询条件
	 */
	public Condition<LocalDateTime> modifiedTime() {
		this.modifiedTimeCondition = new Condition<>();
		return this.modifiedTimeCondition;
	}
	
	/**
	 * 获取修改时间查询条件
	 * 
	 * @return modifiedTimeCondition 修改时间查询条件
	 */
	public Condition<LocalDateTime> getModifiedTimeCondition() {
		return modifiedTimeCondition;
	}

	/**
	 * 设置修改时间查询条件
	 * 
	 * @param modifiedTimeCondition 修改时间查询条件
	 */
	public void setModifiedTimeCondition(Condition<LocalDateTime> modifiedTimeCondition) {
		this.modifiedTimeCondition = modifiedTimeCondition;
	}

	/**
	 * 构造并返回逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> del() {
		this.delCondition = new Condition<>();
		return this.delCondition;
	}
	
	/**
	 * 获取逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @return delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public Condition<Boolean> getDelCondition() {
		return delCondition;
	}

	/**
	 * 设置逻辑删除，1表示已删除,0表示未删除查询条件
	 * 
	 * @param delCondition 逻辑删除，1表示已删除,0表示未删除查询条件
	 */
	public void setDelCondition(Condition<Boolean> delCondition) {
		this.delCondition = delCondition;
	}

	/**
	 * 构造并返回删除人查询条件
	 * 
	 * @return delByCondition 删除人查询条件
	 */
	public Condition<String> delBy() {
		this.delByCondition = new Condition<>();
		return this.delByCondition;
	}
	
	/**
	 * 获取删除人查询条件
	 * 
	 * @return delByCondition 删除人查询条件
	 */
	public Condition<String> getDelByCondition() {
		return delByCondition;
	}

	/**
	 * 设置删除人查询条件
	 * 
	 * @param delByCondition 删除人查询条件
	 */
	public void setDelByCondition(Condition<String> delByCondition) {
		this.delByCondition = delByCondition;
	}

	/**
	 * 构造并返回删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> delTime() {
		this.delTimeCondition = new Condition<>();
		return this.delTimeCondition;
	}
	
	/**
	 * 获取删除时间查询条件
	 * 
	 * @return delTimeCondition 删除时间查询条件
	 */
	public Condition<LocalDateTime> getDelTimeCondition() {
		return delTimeCondition;
	}

	/**
	 * 设置删除时间查询条件
	 * 
	 * @param delTimeCondition 删除时间查询条件
	 */
	public void setDelTimeCondition(Condition<LocalDateTime> delTimeCondition) {
		this.delTimeCondition = delTimeCondition;
	}

}
